package com.straw.jdk.algorithm.leetcode;

import java.util.LinkedList;

/**
 * @author jianshan@byai.com
 * @date 2020/12/8 10:09 AM
 * describe:
 */
public class ArrayProblem {



    private static LinkedList<LinkedList<Integer>> resp = new LinkedList<>();

    public static void main(String[] args) {
        String str = "1123";
        slip2Fibonacci(str,new LinkedList<>());
        System.out.println(resp);
    }



    private static void slip2Fibonacci(String str, LinkedList<Integer> track){
        //终止条件
        if (str.length() < 1 ) {
            System.out.println(track);
            resp.add(track);
            track.clear();
            return;
        }
        for (int i  = 1 ; i <= str.length() ; i++) {
            String subStr = str.substring(0, i);
            if (Long.valueOf(subStr) > Integer.MAX_VALUE) {
                break;
            }
            track.add(Integer.valueOf(subStr));
            slip2Fibonacci(str.substring(i,str.length()),track);
        }
    }

}
